package com.xiangban.yanglaodajie_platform.controller;

import com.xiangban.yanglaodajie_platform.entity.ThirdApiConfig;
import com.xiangban.yanglaodajie_platform.entity.res.ApiResult;
import com.xiangban.yanglaodajie_platform.service.ThirdApiConfigService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/api/third/user")
public class ThirdApiConfigController {
    @Autowired
    private ThirdApiConfigService thirdApiConfigService;


    @PostMapping("/auth")
    @ApiOperation("获取token")
    public ApiResult<Object> auth(@RequestBody ThirdApiConfig thirdApiConfig ) {
        return ApiResult.newSuccess(thirdApiConfigService.getInfo(thirdApiConfig));
    }
}
